from model.base_model import BaseModel
from langchain_ollama import OllamaEmbeddings

class NomicEmbedText(BaseModel):
    def __init__(self):
        # 初始化嵌入模型
        self.embed_model = OllamaEmbeddings(model="nomic-embed-text")
    
    def query_vertory(self, text):
        # 使用embed_documents方法生成嵌入向量
        embeddings = self.embed_model.embed_documents([text])
        return embeddings[0] if embeddings else []
    
    def get_llm_model(self):
        return self.embed_model